/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: PduRCfg.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: PDUR
*
*******************************************************************************/

#ifndef PDURCFG_H
#define PDURCFG_H

/** HEADER FILES **/
#include "PduRType.h"
#include "PduRRte.h"


/** MACRO DEFINITION **/

/* PduHandleId */
#define PduRConf_PduHandleId_CanIf_Tx_YT_Can1_0x101 0u
#define PduRConf_PduHandleId_CanIf_Tx_YT_Can2_0x102 1u
#define PduRConf_PduHandleId_CanIf_Rx_Other_Can1_0x201 2u
#define PduRConf_PduHandleId_CanIf_Rx_Other_Can2_0x202 3u
#define PduRConf_PduHandleId_Com_Tx_YT_Can1_0x101 4u
#define PduRConf_PduHandleId_Com_Tx_YT_Can2_0x102 5u
#define PduRConf_PduHandleId_Com_Rx_Other_Can1_0x201 6u
#define PduRConf_PduHandleId_Com_Rx_Other_Can2_0x202 7u
#define PduRConf_PduHandleId_Dcm_DiagResponse 8u
#define PduRConf_PduHandleId_Dcm_DiagPhyRequest 9u
#define PduRConf_PduHandleId_Dcm_DiagFuncRequest 10u
#define PduRConf_PduHandleId_CanTp_DiagResponse 11u
#define PduRConf_PduHandleId_CanTp_DiagPhyRequest 12u
#define PduRConf_PduHandleId_CanTp_DiagFuncRequest 13u
#define PDURCONF_HANDLEID_MAX 14u


/* Routing path ID */
#define PduRConf_RoutingPath_Rx_CanIfCan0_To_ComCan0 0u
#define PduRConf_RoutingPath_Rx_CanIfCan1_To_ComCan1 1u
#define PduRConf_RoutingPath_Tx_ComCan0_To_CanIfCan0 2u
#define PduRConf_RoutingPath_Tx_ComCan1_To_CanIfCan1 3u
#define PduRConf_RoutingPath_Rx_CanTpDiagPhyRequest_To_DcmDiagPhyRequest 4u
#define PduRConf_RoutingPath_Tx_DcmDiagResponse_To_CanIfDiagResponse 5u
#define PDURCONF_ROUTINGPATH_MAX 6u


/** TYPEDEF DEFINITION **/

typedef struct
{
    CanTpTxIdType CanTpIndex;
}PduR_TxConfigType;


typedef struct
{
    CanTpTxIdType PduRIndex;
}PduR_RxConfigType;


typedef struct
{
    PduR_DestPduDataProvisionType pduDataProvision;
    PduIdType destPduHandleId;
    uint8 transmissionConfirmation;
    uint8 destPduRef; /* PduRDestPduRef */
}PduR_DestPduType;


typedef struct
{
    uint8 blockSize; /* PduRSourcePduBlockSize  */
    uint8 sourcePduHandleId; /* PduRSourcePduHandleId */
    uint8 srcPduUpTxConf; /* PduRSrcPduUpTxConf */
    uint8 srcPduRef; /* PduRSrcPduRef */
}PduR_SrcPduType;


typedef struct
{
    PduR_DestPduType* destPduPtr; /* PduRDestPduRRef */
    PduR_SrcPduType* srcPduPtr; /* PduRSrcPduRRef */
    uint8 queueDepth;/* PduRQueueDepth */
    uint16 tpThreshold;/* PduRTpThreshold */
    uint8* destBufferPtr; /* PduRDestBufferRef */
    PduR_RoutingModeType routingMode; /* RoutingMode */
}PduR_RoutingPathType;



/** LOCAL DATA DEFINITION **/
extern const PduR_RoutingPathType PduR_RoutingPath[PDURCONF_ROUTINGPATH_MAX];
extern const PduR_ProviderFctIfType PduR_ProviderFctIf[PDUR_ROUTINGMODE_MAX];


#endif
